﻿<MudCard Style="height: 100%">
    <MudCardHeader>
        <CardHeaderAvatar>
            <MudAvatar Size="Size.Large" Class="mud-elevation-4">
                <MudImage Src="@Member.Avatar" Alt="GitHub Avatar" />
            </MudAvatar>
        </CardHeaderAvatar>

        <CardHeaderContent>
            <div class="d-flex flex-row justify-space-between">
                <div class="d-flex flex-column">
                    <MudText Typo="Typo.h6">@Member.Name</MudText>

                    <MudText Typo="Typo.body2">@Member.GitHub</MudText>
                </div>

                @if (!string.IsNullOrWhiteSpace(Member.From))
                {
                    <div class="d-flex flex-row align-self-start align-center justify-center">
                        <MudIcon Icon="@Icons.Material.Filled.Place" Color="Color.Inherit" Class="me-1" />

                        <MudText Typo="Typo.body2">
                            @Member.From
                        </MudText>
                    </div>
                }
            </div>
        </CardHeaderContent>
    </MudCardHeader>

        <MudCardContent Class="py-0">
            @if (!string.IsNullOrWhiteSpace(Member.Bio))
            {
                <MudText Typo="Typo.body2">@Member.Bio</MudText>
            }
        </MudCardContent>

    <MudCardActions>
        <MudChip T="string" Variant="Variant.Outlined" Icon="@Icons.Custom.Brands.GitHub" Color="Color.Inherit" Target="_blank" Href="@($"https://github.com/{Member.GitHub}")">
            GitHub
        </MudChip>

        @if (Member.GitHubSponsor)
        {
            <MudChip T="string" Variant="Variant.Outlined" Icon="@Icons.Material.Filled.FavoriteBorder" Color="Color.Secondary" Target="_blank" Href="@($"https://github.com/sponsors/{Member.GitHub}")">
                Sponsor
            </MudChip>
        }

        @if (!string.IsNullOrWhiteSpace(Member.LinkedIn))
        {
            <MudChip T="string" Variant="Variant.Outlined" Icon="@Icons.Custom.Brands.LinkedIn" Color="Color.Primary" Target="_blank" Href="@Member.LinkedIn">
                LinkedIn
            </MudChip>
        }
    </MudCardActions>
</MudCard>

@code {
    [Parameter] public TeamMember Member { get; set; }
}
